<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增餐厅菜单')"/>


    <link th:href="@{/upload/upload.css}" rel="stylesheet"/>


</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-WxCanteenMenu-add">
        <input name="menuCid" id="menuCid" class="form-control"  type="hidden" th:value="*{cid}" required>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">菜品名称
                ：</label>
            <div class="col-sm-10">
                <input name="menuName" id="menuName" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">菜品图片
                ：</label>
            <div class="col-sm-10">
                <div class="upload" action='upload.html' data-num="1" data-value='' id="piclist_menuPic"></div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">单位
                ：</label>
            <div class="col-sm-10">
                <input name="menuUnit" id="menuUnit" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">菜品价格
                ：</label>
            <div class="col-sm-10">
                <input name="menuPrice" id="menuPrice" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">排序
                ：</label>
            <div class="col-sm-10">
                <input name="menuSort" id="menuSort" class="form-control"
                       type="text" required>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "wechat/WxCanteenMenu"


    $("#form-WxCanteenMenu-add").validate({
        focusCleanup: true
    });


    //单图上传
    $("#piclist_menuPic").upload(function () {
    }, "menuPic")

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-WxCanteenMenu-add').serialize());
        }
    }
</script>
</body>
</html>
